-
Notifications
You must be signed in to change notification settings - Fork 13.3k
stabilize const_cell_into_inner #130972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stabilize const_cell_into_inner #130972
Conversation
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
This comment has been minimized.
This comment has been minimized.
Seems to be something with cranelift?
Cc @bjorn3 |
The |
I would be happy to approve this including
Please try deleting these lines: rust/compiler/rustc_codegen_cranelift/patches/0027-stdlib-128bit-atomic-operations.patch Lines 85 to 97 in a1fd235
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
@bors r+ |
This const-stabilizes
UnsafeCell::into_inner
Cell::into_inner
RefCell::into_inner
OnceCell::into_inner
@rust-lang/wg-const-eval this uses
rustc_allow_const_fn_unstable(const_precise_live_drops)
, so we'd be comitting to always finding some way to accept this code. IMO that's fine -- what these functions do is to move out the only field of a struct, and that struct has no destructor itself. The field's destructor does not get run as it gets returned to the caller.@rust-lang/libs-api this was FCP'd already years ago, except that
OnceCell::into_inner
was added to the same feature gate since then (Cc @tgross35). Does that mean we have to re-run the FCP? If yes, I'd honestly prefer to moveOnceCell
into its own feature gate to not risk missing the next release. (That's why it's not great to add new functions to an already FCP'd feature gate.) OTOH if this needs an FCP either way since the previous FCP was so long ago, then we might as well do it all at once.